bitkeeper revision 1.1159.1.481 (41c07f85G2hWDdcToBM9klxqtewYlQ)
authorcl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Wed, 15 Dec 2004 18:16:37 +0000 (18:16 +0000)
committercl349@arcadians.cl.cam.ac.uk <cl349@arcadians.cl.cam.ac.uk>
Wed, 15 Dec 2004 18:16:37 +0000 (18:16 +0000)
Bound number of vcpus by XEN_VCPUS environment variable in xend environment.

tools/libxc/xc_linux_build.c

index 052611852e5b5b7528d8b7e0f3908e191e2a5e3d..2540819d5fd7bbbb90a413f185eb06e695f45894 100644 (file)
@@ -127,6 +127,8 @@ static int setup_guestos(int xc_handle,
     unsigned long vpt_end;
     unsigned long v_end;
 
+    char *n_vcpus;
+
     memset(&dsi, 0, sizeof(struct domain_setup_info));
 
     rc = parseelfimage(image, image_size, &dsi);
@@ -335,7 +337,11 @@ static int setup_guestos(int xc_handle,
     /* Mask all upcalls... */
     for ( i = 0; i < MAX_VIRT_CPUS; i++ )
         shared_info->vcpu_data[i].evtchn_upcall_mask = 1;
-    shared_info->n_vcpu = 32;
+    n_vcpus = getenv("XEN_VCPUS");
+    if ( n_vcpus )
+       shared_info->n_vcpu = atoi(n_vcpus);
+    else
+       shared_info->n_vcpu = 1;
     munmap(shared_info, PAGE_SIZE);
 
     /* Send the page update requests down to the hypervisor. */